<?php


/**
* Puree CMS
* http://www.molotsoft.ru
*
* @package Puree_CMS
* @subpackage Models
* @author Ivan Chistyakov <ivan@molotsoft.ru>
* @version $Id: setting.php 1256 2010-04-01 13:40:05Z molotsoft@gmail.com $
* @link $HeadURL: http://puree-cms.googlecode.com/svn/trunk/models/setting.php $
*/


class Setting extends GeneralModel {

/******************************************************************************/

var $name = 'Setting';

var $displayField = 'project_title';

var $order = array(
	'Setting.id' => 'ASC'
);

var $actsAs = array(
	'Admin.Automate',
	'Containable'
);

var $fieldInputSchema = array(
	'about_company' => array('type' => 'wysiwyg'),
	'footer_copyright' => array('type' => 'wysiwyg'),
	'footer_contacts' => array('type' => 'wysiwyg'),
	'footer_address' => array('type' => 'wysiwyg'),
	'footer_phones' => array('type' => 'wysiwyg')
);

var $tabSchema = array(
	'header' => array('icon' => 'tab'),
	'footer' => array('icon' => 'tab')
);

/******************************************************************************/

function _describeFieldInput($field_name, $field_description = array()) {
	// change tab
	if ((bool)preg_match('~^(header|footer)(_[a-z0-9_]+)?$~', $field_name, $match)) {
		$field_description['input']['tab'] = $match[1];
	}
	return $field_description['input'];
}

/******************************************************************************/

/*function beforeDelete($cascade) {
	return FALSE;
}*/

/******************************************************************************/

}


?>